// loading需要显示加载框
import fetch from './request'

/**
 * 商家信息
 * @param {*} params
 */
export function shopInfo(params) {
  return fetch({
    url: '/api/Shop/detail',
    method: 'post',
    params: {
      loading: false
    },
    data: {
      ...params
    }
  })
}

export function loginApi(params) {
  return fetch({
    url: '/api/User/login',
    method: 'post',
    params: {
      loading: false
    },
    data: {
      ...params
    }
  })
}

export function registerApi(params) {
  return fetch({
    url: '/api/User/register',
    method: 'post',
    params: {
      loading: false
    },
    data: {
      ...params
    }
  })
}

export function indexApi() {
  return fetch({
    url: '/api/Index/index',
    method: 'get',
    params: {
      loading: false
    },
    data: {}
  })
}

export function commonSysApi() {
  return fetch({
    url: '/api/Common/sys',
    method: 'get',
    params: {
      loading: false
    },
    data: {}
  })
}

export function articleCateApi(param) {
  return fetch({
    url: '/api/Article/catelist',
    method: 'get',
    params: {
      ...param,
      loading: false
    },
    data: {}
  })
}

export function articleListApi(param) {
  return fetch({
    url: '/api/Article/list',
    method: 'get',
    params: {
      ...param,
      loading: false
    },
    data: {}
  })
}

export function articleDetailApi(param) {
  return fetch({
    url: '/api/Article/detail',
    method: 'get',
    params: {
      ...param,
      loading: false
    },
    data: {}
  })
}
/**视屏增加次数 */
export function articlePlayApi(params) {
  return fetch({
    url: '/api/Article/play',
    method: 'post',
    params: {
      loading: false
    },
    data: {
      ...params
    }
  })
}
export function articlePlayNumApi(param) {
  return fetch({
    url: '/api/Article/play',
    method: 'get',
    params: {
      ...param,
      loading: false
    },
    data: {}
  })
}
/**视屏评价 */
export function commentApi(params) {
  return fetch({
    url: '/api/Comments/comment',
    method: 'post',
    params: {
      loading: false
    },
    data: {
      ...params
    }
  })
}
/**评价列表 */
export function commentsListApi(param) {
  return fetch({
    url: '/api/Comments/list',
    method: 'get',
    params: {
      ...param,
      loading: false
    },
    data: {}
  })
}
export function getJson(url) {
  return fetch({
    url: url,
    method: 'get',
    params: {
      loading: false
    },
    data: {}
  })
}
